<?php 
  require_once("../../includes/config.php"); 
  $period = -1;
  if(isset($_GET['id']))
  {
    $thereID = 1;
    $id = $_GET['id'];
    $name = $_GET['name'];
    
    //get its prices by figuring what what's the current period
    $currentdate = date('m/d/Y', time());
    $dates = query('SELECT * FROM periods');
    foreach($dates as $date)
    {
      if(check_in_range($date['period_from'], $date['period_to'], $currentdate))
      {
        $period = $date["period_id"];
        break;
      }
    }
  }
  else
  {
    $thereID = 0;
    $id = -1;
    $name = -1;
  }
  renderWithoutHeader("Bookings/Create.php",array("thereID"=>$thereID,"apar_id"=>$id,"apar_name"=>$name,"period"=>$period));
  

?>